#!/bin/bash

chmod +x ./lib/dex2jar/dex2jar.sh
chmod +x ./lib/jad

./lib/dex2jar/dex2jar.sh ./classes.dex

mkdir classes
cd ./classes

jar xvf ../classes_dex2jar.jar

cd ..

mkdir javas
cd ./javas

find ../classes/ -name "*.class" -exec ../lib/jad -o -r -s .java '{}' \;

cd ..

echo "delete template files"

rm -fv ./classes_dex2jar.jar

echo "done"
